package com.yupi.referral.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.referral.model.dto.referral.ReferralQueryRequest;
import com.yupi.referral.model.entity.Referral;
import com.yupi.referral.model.vo.ReferralVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author ZRETC
* @description 针对表【referral(内推)】的数据库操作Service
* @createDate 2024-06-28 17:11:01
*/
public interface ReferralService extends IService<Referral> {


    /**
     * 校验
     *
     * @param referral
     * @param add
     */
    void validReferral(Referral referral, boolean add);

    /**
     * 获取查询条件
     *
     * @param referralQueryRequest
     * @return
     */
    QueryWrapper<Referral> getQueryWrapper(ReferralQueryRequest referralQueryRequest);

    /**
     * 获取内推封装
     *
     * @param referral
     * @param request
     * @return
     */
    ReferralVO getReferralVO(Referral referral, HttpServletRequest request);

    /**
     * 分页获取内推封装
     *
     * @param referralPage
     * @param request
     * @return
     */
    Page<ReferralVO> getReferralVOPage(Page<Referral> referralPage, HttpServletRequest request);
}
